import requests
import os

# 音效文件的URL
sound_urls = {
    'match': 'https://example.com/match.mp3',
    'select': 'https://example.com/select.mp3',
    'gameOver': 'https://example.com/gameover.mp3',
    'error': 'https://example.com/error.mp3'
}

# 创建一个目录来存储音效文件
if not os.path.exists('sounds'):
    os.makedirs('sounds')

# 下载音效文件
for sound_name, url in sound_urls.items():
    response = requests.get(url)
    if response.status_code == 200:
        with open(f'sounds/{sound_name}.mp3', 'wb') as f:
            f.write(response.content)
        print(f'Successfully downloaded {sound_name}.mp3')
    else:
        print(f'Failed to download {sound_name}.mp3')

print('All downloads completed.')